<!DOCTYPE html>
<html>
<head>
    <title>String | Sencha Test 1.0.3 </title>
    <!--  Generated on August, 12 2016 at 15:48 -->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta property="og:image" content="home-images/sencha-200.png" />
    <meta property="og:title" content="String | Sencha Test 1.0.3 " />
    <meta property="og:description" content="String is a global object that may be used to construct String instances.String objects may be created by calling the constructor new String(). The String ob..." />
    <meta property="og:site_name" content="Sencha Documentation" />
    <meta property="og:url" content="http://docs.sencha.com/sencha_test/String.html" />
    <meta name="description" content="String is a global object that may be used to construct String instances.String objects may be created by calling the constructor new String(). The String ob...">
    <style>
        /*!
         *  Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome
         *  License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
         */
        /* FONT PATH
         * -------------------------- */
        @font-face {
            font-family: 'FontAwesome';
            src: url('css/fonts/fontawesome-webfont.eot?v=4.5.0');
            src: url('css/fonts/fontawesome-webfont.eot@#iefix&v=4.5.0') format('embedded-opentype'),
            url('css/fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'),
            url('css/fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'),
            url('css/fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'),
            url('css/fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
            font-weight: normal;
            font-style: normal;
        }

    </style>
    <link rel="stylesheet" type="text/css" href="css/prism.css">
        <link rel="stylesheet" type="text/css" href="css/app.css">
        <link rel='canonical' href='default.htm' /><meta name='description' content='Sencha Test API Documentation from Sencha.' />
</head>
<body class=" is-api  has-guides   has-api tree-shown">
    <script type="text/javascript">
        function getOS() {
            var userAgent = navigator.userAgent || navigator.vendor || window.opera;

            if(/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
                return 'ios';
            } else if(userAgent.match(/Android/i)) {
                return 'android';
            }
        }

        var hash = document.location.hash,
                rawhash, newhash, prop, member,
                isIE8 = false;

        if(hash.indexOf('#!') > -1) {
            hash    = hash.replace('#!/api/','');
            rawhash = hash.split('-'),
            prop    = (rawhash[1] == 'static') ? rawhash[2] : rawhash[1],
            member  = (rawhash[1] == 'static') ? rawhash[3] : rawhash[2],
            newhash = rawhash[0] + '.html';

            if (prop && member) {
                newhash += '#' + prop + '-' + member;
            }

            document.location.href = newhash;
        }

        document.body.className += ' ' + getOS();
    </script>
    <!--[if IE 8]>
    <script type='text/javascript'>
        isIE8 = true;
    </script>
    <![endif]-->
    <script type="text/javascript">
        var ExtL = ExtL || {},
            specificId = '',
            isClassTemplate = true,
            isHome = false,
            isLanding = false,
            isApi = true,
            isGuide = false,
            hasApi = true,
            hasGuides = true,
            hasQuickStart = false
            singleton = false,
            pageName = 'String',
            pageTitle = 'Sencha Test',
            homePath = '',
            product = 'test',
            pversion = '1.0.3-orion',
            hasVersions = false,
            myToolkit = 'false';

            if (!isIE8) {
                document.write('<script type=\"text/javascript\" src=\"js/prism.js\"><\/script>');
            }
    </script>
    <script type="text/javascript" src="js/ace.js"></script>
    <script type="text/javascript" src="js/beautify.js"></script>
    <script type="text/javascript" src="js/app.js"></script>
    <div id="help-wrap">
        <div class="help-header">
            Docs Help
            <div id="help-close"></div>
        </div>
        <div class="classText">
            <div class="toc">
                <h2>内容</h2>
                    <a class="toc-page-h2" href="#terms-icons-and-labels">Terms, Icons, and Labels</a>
                    <a class="toc-page-h3" href="#access-levels">Access Levels</a>
                    <a class="toc-page-h3" href="#member-types">Member Types</a>
                    <a class="toc-page-h3" href="#member-syntax">Member Syntax</a>
                    <a class="toc-page-h3" href="#member-flags">Member Flags</a>
                    <a class="toc-page-h3" href="#class-icons">Class Icons</a>
                    <a class="toc-page-h3" href="#member-icons">Member Icons</a>
                    <a class="toc-page-h2" href="#navigation-and-features">Navigation and Features</a>
                    <a class="toc-page-h3" href="#class-member-quick-nav-menu">Class Member Quick-Nav Menu</a>
                    <a class="toc-page-h3" href="#getter-and-setter-methods">Getter and Setter Methods</a>
                    <a class="toc-page-h3" href="#history-bar">History Bar</a>
                    <a class="toc-page-h3" href="#search-and-filters">Search and Filters</a>
                    <a class="toc-page-h3" href="#api-doc-class-metadata">API Doc Class Metadata</a>
                    <a class="toc-page-h3" href="#expanding-and-collapsing-examples-and-class-members">Expanding and Collapsing Examples and Class Members</a>
                    <a class="toc-page-h3" href="#desktop-vs-mobile-view">Desktop -vs- Mobile View</a>
                    <a class="toc-page-h3" href="#viewing-the-class-source">Viewing the Class Source</a>
            </div>
            <h2 id="terms-icons-and-labels">Terms, Icons, and Labels</h2>
    <p>Many classes have shortcut names used when creating (instantiating) a class with a 
    configuration object.  The shortcut name is referred to as an <code>alias</code> (or <code>xtype</code> if the 
    class extends Ext.Component).  The alias/xtype is listed next to the class name of 
    applicable classes for quick reference.</p>
    <h3 id="access-levels">Access Levels</h3>
    <p>Framework classes or their members may be specified as <code>private</code> or <code>protected</code>.  Else, 
    the class / member is <code>public</code>.  <code>Public</code>, <code>protected</code>, and <code>private</code> are access 
    descriptors used to convey how and when the class or class member should be used.</p>
    <ul>
    <li><p><strong>Public</strong> classes and class members are available for use by any other class or 
    application code and may be relied upon as a stable and persistent within major product 
    versions.  Public classes and members may safely be extended via a subclass.</p>
    </li>
    <li><p><strong>Protected</strong> class members are stable <code>public</code> members intended to be used by the 
    owning class or its subclasses.  Protected members may safely be extended via a subclass.</p>
    </li>
    <li><p><strong>Private</strong> classes and class members are used internally by the framework and are not 
    intended to be used by application developers.  Private classes and members may change or 
    be omitted from the framework at any time without notice and should not be relied upon in 
    application logic.</p>
    </li>
    </ul>
    <h3 id="member-types">Member Types</h3>
    <ul>
    <li><strong>Config</strong> - The configuration options for a class.</li>
    <li><strong>Property</strong> - Set once a class is instantiated. *See Read Only below.</li>
    <li><strong>Method</strong> - Actions that can be performed by a class.  Methods should be read as 
    instance methods and can only be called from a instance of a given class.  Static methods 
    that can be called directly from the class itself will have a <code>static</code> label next to the 
    method name.  *See Static below.</li>
    <li><strong>Event</strong> - Events are specific to the framework event system allowing for classes to 
    programmatically raise an event to be handled by one or more event handler methods.  DOM 
    events, while handled by the framework event system, are not specifically described 
    within the API documentation.  *For DOM events refer to the 
    <a href="../../https@developer.mozilla.org/en-US/docs/Web/Events">event reference</a> page from MDN.</li>
    <li><strong>Theme Variable</strong> - Variables used by the visual theme engine employed by the 
    framework.</li>
    <li><strong>Theme Mixin</strong> - Functions used by the visual theme engine employed by the framework 
    and may use values set in various Theme Variables.</li>
    </ul>
    <h3 id="member-syntax">Member Syntax</h3>
    <p>Below is an example class member that we can disect to show the syntax of a class member 
    (the lookupComponent method as viewed from the Ext.button.Button class in this case).</p>
    <div style="position: relative;" class="show-inherited show-protected members">
        <div style="border: 1px solid #E4E4E4;" class="classmembers member-protected isNotStatic isInherited member-temp-expanded" data-member-name="lookupComponent">
            <div class="collapse-toggle"></div>
            <div class="source-class"><a href="javascript:void(0);">Ext.container.Container</a><div class="viewSource"><a href="javascript:void(0);"></a><a target="_blank" href="javascript:void(0);">view source</a></div></div>
            <div class="member-header">
            <a href="javascript:void(0);" class="member-name-link"><span data-ref="method-lookupComponent" class="member-name"><strong>lookup</strong>Component</span></a>
            <span class="params-list"> ( item )</span> : <span class="memberType">Ext.Component</span>
            <div class="member-tags"><span class="protected">protected</span></div>
        </div>
            <p>Called when a raw config object is added to this container either during initialization of the <a href="javascript:void(0);">items</a> config,
        or when new items are <a href="javascript:void(0);">added), or {@link #insert inserted</a>.</p>
        <p>This method converts the passed object into an instanced child component.</p>
        <p>This may be overridden in subclasses when special processing needs to be applied to child creation.</p>
                    <div class="detail-header">Parameters</div>
                <p><span class="params-list">item</span> :
                        <span class="memberType">&nbsp;Object</span>
                </p>
                <div class="params-desc"><p>The config object being added.</p></div>
                <div class="detail-header">Returns</div>
                <span style="margin-left:12px;" class="memberType">Ext.Component</span>
                <div class="return-desc"><p>The component to be added.</p>
            </div>
        </div>
    </div>
    
    <p>Let&#39;s look at each part of the member row:</p>
    <ul>
    <li><strong>Expand/Collapse</strong> - On the left-hand size of the member row is a control used to 
    expand and collapse each member row to show / hide member details.</li>
    <li><strong>Member Name</strong> - The name of the class member (<code>lookupComponent</code> in this example)</li>
    <li><strong>Method Param</strong> - Any required or optional params used by a method (or passed to an 
    event handler method) will be listed next to the method name within parenthesis 
    (<code>( item )</code> in this example)</li>
    <li><strong>Return type</strong> - The class instance or javascript object returned by the method or 
    property (<code>Ext.Component</code> in this case).  This may be omitted for methods that do not 
    return anything other than <code>undefined</code> or may display as multiple possible values 
    separated by a forward slash <code>/</code> signifying that what is returned may depend on the 
    results of the method call (i.e. a method may return a Component if a get method calls is 
    successful or <code>false</code> if unsuccessful which would be displayed as 
    <code>Ext.Component/Boolean</code>).</li>
    <li><strong>Flags</strong> - Any flags applicable to the member will be displayed next (<code>PROTECTED</code> in 
    this example - see the Flags section below)</li>
    <li><strong>Member Origin</strong> - On the right-hand side of the member row is the class where the 
    member was initially described (<code>Ext.container.Container</code> in this example).  The source 
    class will be displayed as a blue link if the member originates from the current class 
    and gray if it is inherited from an ancestor or mixed-in class.</li>
    <li><strong>Member Source</strong> - On the right-hand side below the member origin class is a link to 
    view the member&#39;s source (<code>view source</code> in the example)</li>
    <li><strong>Params List</strong> - Each param for a class method will be listed using the same name 
    found above in parenthesis, the type of class or object expected, and a description of 
    the param (<code>item : Object</code> in the example).</li>
    <li><strong>Returns</strong> - If a class returns a value other than <code>undefined</code> a &quot;Returns&quot; section 
    will note the type of class or object returned and a description (<code>Ext.Component</code> in the 
    example)</li>
    <li><strong>Since</strong> (<em>not shown in the example</em>) - Some members will show which version of the 
    product the member was first introduced (i.e. <code>Available since 3.4.0</code> - <em>not pictured in 
    the example</em>) just after the member description</li>
    <li><strong>Default</strong> (<em>not shown in the example</em>) - Configs often show the default config value 
    to be applied to a class instance if not overridden (i.e. <code>Defaults to: false</code>)</li>
    </ul>
    <h3 id="member-flags">Member Flags</h3>
    <p>The API documentation uses a number of flags to further commnicate the class member&#39;s 
    function and intent.  The label may be represented by a text label, an abbreviation, or 
    an icon.</p>
    <ul>
    <li><strong>Required</strong> - Required config when instantiating a class</li>
    <li><strong>Bindable</strong> - The config has a setter which allows this config to be set via ViewModel 
    binding</li>
    <li><strong>Read Only</strong> - The property may be read, but cannot be used to configure / 
    re-configure a class instance at runtime</li>
    <li><strong>Singleton</strong> - Singleton classes are instantiated immediately once defined and may not 
    be instantiated manually</li>
    <li><strong>Static</strong> - A static method or property is a method or property belonging to the class 
    itself, not an instance of the class</li>
    <li><strong>Chainable</strong> - Refers to methods that return the class instance back when called.<br>This enables chained method calls like: <code>classInstance.method1().method2().etc();</code></li>
    <li><strong>Deprecated</strong> - A class or member that is scheduled for removal in a future 
    framework version and is provided in the current version for backwards compatibility.<br>Deprecated classes and members will have a message directing you to the preferred class / 
    method going forward.</li>
    <li><strong>Removed</strong> - A removed class or member that exists in documentation only as a 
    reference for users upgrading between framework versions</li>
    <li><strong>Template</strong> - A method defined within a base class designed to be overridden by 
    subclasses</li>
    <li><strong>Abstract</strong> - A class or member may be be defined as abstract.  Abstract classes and 
    members establish a class structure and provide limited, if any, code.  Class-specific 
    code will be furnished via overrides in subclasses.</li>
    <li><strong>Preventable</strong> - Events marked preventable will not fire if <code>false</code> is returned from 
    an event handler</li>
    </ul>
    <h3 id="class-icons">Class Icons</h3>
    <p><span class="icon-demo class-icon"></span> - Indicates a framework class  </p>
    <p><span class="icon-demo singleton-icon"></span> - A singleton framework class. *See the 
    singleton flag for more information  </p>
    <p><span class="icon-demo component-icon"></span> - A component-type framework class (any 
    class within the Ext JS framework that extends Ext.Component)  </p>
    <p><span class="icon-demo display-new"></span> - Indicates that the class, member, or guide 
    is new in the currently viewed version</p>
    <h3 id="member-icons">Member Icons</h3>
    <p><span class="icon-demo fa fa-cubes"></span> - Indicates a class member of type <code>config</code>  </p>
    <p><span class="icon-demo fa fa-book"></span> - Indicates a class member of type <code>property</code>  </p>
    <p><span class="icon-demo fa fa-object-group"></span> - Indicates a class member of type 
    <code>method</code>  </p>
    <p><span class="icon-demo fa fa-bolt"></span> - Indicates a class member of type <code>event</code>  </p>
    <p><span class="icon-demo fa fa-paint-brush"></span> - Indicates a class member of type 
    <code>theme variable</code>  </p>
    <p><span class="icon-demo fa fa-tint"></span> - Indicates a class member of type 
    <code>theme mixin</code>  </p>
    <p><span class="icon-demo display-new"></span> - Indicates that the class, member, or guide 
    is new in the currently viewed version</p>
    <h2 id="navigation-and-features">Navigation and Features</h2>
    <h3 id="class-member-quick-nav-menu">Class Member Quick-Nav Menu</h3>
    <p>Just below the class name on an API doc page is a row of buttons corresponding to the 
    types of members owned by the current class.  Each button shows a count of members by 
    type (this count is updated as filters are applied).  Clicking the button will navigate 
    you to that member section.  Hovering over the member-type button will reveal a popup 
    menu of all members of that type for quick navigation.</p>
    <h3 id="getter-and-setter-methods">Getter and Setter Methods</h3>
    <p>Getting and setter methods that correlate to a class config option will show up in the 
    methods section as well as in the configs section of both the API doc and the member-type 
    menus just beneath the config they work with.  The getter and setter method documentation 
    will be found in the config row for easy reference.</p>
    <h3 id="history-bar">History Bar</h3>
    <p>Your page history is kept in localstorage and displayed (using the available real estate) 
    just below the top title bar.  By default, the only search results shown are the pages 
    matching the product / version you&#39;re currently viewing.  You can expand what is 
    displayed by clicking on the <span class="icon-demo history-config"></span> button on the 
    right-hand side of the history bar and choosing the &quot;All&quot; radio option.  This will show 
    all recent pages in the history bar for all products / versions.</p>
    <p>Within the history config menu you will also see a listing of your recent page visits. 
    The results are filtered by the &quot;Current Product / Version&quot; and &quot;All&quot; radio options. 
    Clicking on the <span class="icon-demo history-clear"></span> button will clear the history bar as 
    well as the history kept in local storage.</p>
    <p>If &quot;All&quot; is selected in the history config menu the checkbox option for &quot;Show product 
    details in the history bar&quot; will be enabled.  When checked, the product/version for each 
    historic page will show alongside the page name in the history bar.  Hovering the cursor 
    over the page names in the history bar will also show the product/version as a tooltip.</p>
    <h3 id="search-and-filters">Search and Filters</h3>
    <p>Both API docs and guides can be searched for using the search field at the top of the 
    page.</p>
    <p>On API doc pages there is also a filter input field that filters the member rows 
    using the filter string.  In addition to filtering by string you can filter the class 
    members by access level and inheritance.  This is done using the checkboxes at the top of 
    the page.  <strong>Note</strong> that filtering out <code>private</code> members also filters the API class 
    navigation tree.</p>
    <p>Clicking on an empty search field will show your last 10 searches for quick navigation.</p>
    <h3 id="api-doc-class-metadata">API Doc Class Metadata</h3>
    <p>Each API doc page (with the exception of Javascript primitives pages) has a menu view of 
    metadata relating to that class.  This metadata view will have one or more of the 
    following:</p>
    <ul>
    <li><strong>Alternate Name</strong> - One or more additional class name synonymns (in Ext JS 6.0.0 the 
    <code>Ext.button.Button</code> class has an alternate class name of <code>Ext.Button</code>).  Alternate class 
    names are commonly maintained for backward compatibility.</li>
    <li><strong>Hierarchy</strong> - The hierararchy view lists the inheritance chain of the current class 
    up through its ancestor classes up to the root base class.</li>
    <li><strong>Mixins</strong> - A list of classes that are mixed into the current class</li>
    <li><strong>Inherited Mixins</strong> - A list of classes that are mixed into an ancestor of the current 
    class</li>
    <li><strong>Requires</strong> - All classes required to be defined for the class to be instantiated</li>
    <li><strong>Uses</strong> - A list of classes potentially used by the class at some point in its 
    lifecycle, but not necessarily requried for the class to initially be instantiated</li>
    <li><strong>Subclasses</strong> - Classes that extend the current class</li>
    </ul>
    <h3 id="expanding-and-collapsing-examples-and-class-members">Expanding and Collapsing Examples and Class Members</h3>
    <p>Runnable examples (Fiddles) are expanded on a page by default.  You can collapse and 
    expand example code blocks individually using the arrow on the top-left of the code 
    block.  You can also toggle the collapse state of all examples using the toggle button on 
    the top-right of the page.  The toggle-all state will be remembered between page loads.</p>
    <p>Class members are collapsed on a page by default.  You can expand and collapse members 
    using the arrow icon on the left of the member row or globally using the expand / 
    collapse all toggle button top-right.</p>
    <h3 id="desktop-vs-mobile-view">Desktop -vs- Mobile View</h3>
    <p>Viewing the docs on narrower screens or browsers will result in a view optimized for a 
    smaller form factor.  The primary differences between the desktop and &quot;mobile&quot; view are:</p>
    <ul>
    <li>Global navigation will be located in a menu on the left-hand side accessible via the 
    hamburger menu icon.  The menu houses the following (on most pages):<ul>
    <li>The name of the current product (as a link to the product landing page)</li>
    <li>The Sencha icon used to navigate back to the documentation home page</li>
    <li>The product menu drop-down button</li>
    <li>Tabs of navigation trees for the API docs and guides</li>
    </ul>
    </li>
    <li>Current context navigation and tools is located on the right-hand side accessible via 
    the gear icon.  The context menu houses teh following:<ul>
    <li>The global search input field</li>
    <li>(<em>API doc</em>) A &quot;Filters&quot; tab with the member filter, expand / collapse all examples 
    button, expand / collapse all member rows button, the access level filter checkboxes, 
    and the counts of each member</li>
    <li>(<em>API doc</em>) A &quot;Related Classes&quot; tab containing the menu of metadata related to the 
    current class</li>
    <li>(<em>Guides</em>) The table of contents for the guide</li>
    </ul>
    </li>
    </ul>
    <h3 id="viewing-the-class-source">Viewing the Class Source</h3>
    <p>The class source can be viewed by clicking on the class name at the top of an API doc 
    page.  The source for class members can be viewed by clicking on the &quot;view source&quot; link 
    on the right-hand side of the member row.</p>
    
        </div>
    </div>
    <div id="header">
        <div class="logo">
            <a href="../"><img height="32" src="home-images/sencha_logo_thumb.png"/></a>
        </div>
        <span id="mobile-main-nav-menu-btn" class="fa fa-bars"></span>
        <span data-tip="Product / Version Menu" class="fa fa-chevron-circle-down product-menu-btn tooltip tooltip-tl-bl landing-product-menu-btn"><div class="callout callout-b"></div></span>
            <a class="page-title class" href="src/String.js.html#String" target="_blank">String</a>
        <span id="mobile-context-menu-btn" class="fa fa-cog"></span>
    </div>
    <div id="centerContent">
        <div id="history-nav">
            <span id="history-config" class="history-config tooltip tooltip-tr-br" data-tip="Configure / Clear History"><div class="callout callout-b"></div></span>
        </div>
        <div id="class-tree-ct" class="class-tree">
            <h2 class="product-header">
                <div class="logo">
                    <a href="../"><img src="home-images/sencha_logo1x.png"/></a>
                </div>
                <a href="index.html">Sencha Test 1.0.3 </a>
                <span data-tip="Product / Version Menu" class="fa fa-chevron-circle-down product-menu-btn  tooltip tooltip-tl-bl"><div class="callout callout-b"></div></span>
            </h2>
            <div id="tree-header" class="pre-load">
                <div id="guideTab" class="toolbarHeaderButton">
                    Guides
                </div>
                <div id="apiTab" class="toolbarHeaderButton active-tab">
                    API
                </div>
                <div id="hide-class-tree"></div>
            </div>
            <div id="tree-scroller">
                <div id="tree" class="show-private show-protected is-tree">
                    <div class="tree-leaf tree-member">
    <div class="tree-leaf-content isNotLeaf" id="singleton-st" isLeaf="false">
        <span class="tree-expando">▸</span>
            <span class="singleton-type"></span>
            <a class="tree-leaf-text" href="ST.html">ST</a>
    </div>
        <div class="tree-child-leaves hidden">
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isNotLeaf" id="branch-st-event" isLeaf="false">
                        <span class="tree-expando">▸</span>
                                <span class="folder-type"></span>
                            <a class="tree-leaf-text">event</a>
                    </div>
                        <div class="tree-child-leaves hidden">
                                <div class="tree-leaf tree-member-protected">
                                    <div class="tree-leaf-content isLeaf" id="node-st-event-driver" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.event.Driver.html">Driver</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member-private">
                                    <div class="tree-leaf-content isLeaf" id="node-st-event-event" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.event.Event.html">Event</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member-private">
                                    <div class="tree-leaf-content isLeaf" id="node-st-event-gesturequeue" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.event.GestureQueue.html">GestureQueue</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member-private">
                                    <div class="tree-leaf-content isLeaf" id="node-st-event-injector" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.event.Injector.html">Injector</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-event-playable" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.event.Playable.html">Playable</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-event-player" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.event.Player.html">Player</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-event-recorder" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.event.Recorder.html">Recorder</a>
                                    </div>
                                </div>
                        </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isNotLeaf" id="branch-st-future" isLeaf="false">
                        <span class="tree-expando">▸</span>
                                <span class="folder-type"></span>
                            <a class="tree-leaf-text">future</a>
                    </div>
                        <div class="tree-child-leaves hidden">
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-button" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Button.html">Button</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-cell" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Cell.html">Cell</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-checkbox" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.CheckBox.html">CheckBox</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-combobox" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.ComboBox.html">ComboBox</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-component" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Component.html">Component</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-dataview" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.DataView.html">DataView</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-element" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Element.html">Element</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-field" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Field.html">Field</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-grid" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Grid.html">Grid</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-item" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Item.html">Item</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-panel" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Panel.html">Panel</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-picker" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Picker.html">Picker</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-row" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Row.html">Row</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-select" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Select.html">Select</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member-private">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-selection" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.Selection.html">Selection</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member-private">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-selectionmodel" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.SelectionModel.html">SelectionModel</a>
                                    </div>
                                </div>
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-future-textfield" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.future.TextField.html">TextField</a>
                                    </div>
                                </div>
                        </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isNotLeaf" id="branch-st-locator" isLeaf="false">
                        <span class="tree-expando">▸</span>
                                <span class="folder-type"></span>
                            <a class="tree-leaf-text">locator</a>
                    </div>
                        <div class="tree-child-leaves hidden">
                                <div class="tree-leaf tree-member">
                                    <div class="tree-leaf-content isLeaf" id="node-st-locator-strategy" isLeaf="true">
                                        <span class="tree-expando hidden">▸</span>
                                                <span class="class-type"></span>
                                            <a class="tree-leaf-text" href="ST.locator.Strategy.html">Strategy</a>
                                    </div>
                                </div>
                        </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="node-st-alert" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Alert.html">Alert</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-protected">
                    <div class="tree-leaf-content isLeaf" id="node-st-block" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Block.html">Block</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="node-st-browser" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Browser.html">Browser</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-browser-1" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.browser-1.html">browser</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="node-st-element" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Element.html">Element</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-private">
                    <div class="tree-leaf-content isLeaf" id="node-st-gate" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Gate.html">Gate</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-private">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-jasmine" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.jasmine.html">jasmine</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-locator" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.Locator.html">Locator</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-options" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.options.html">options</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-os-1" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.os-1.html">os</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="node-st-os" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.OS.html">OS</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-private">
                    <div class="tree-leaf-content isLeaf" id="node-st-spec" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Spec.html">Spec</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-private">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-status" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.status.html">status</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-private">
                    <div class="tree-leaf-content isLeaf" id="node-st-suite" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Suite.html">Suite</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-supports" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.supports.html">supports</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-private">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-system" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.system.html">system</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-private">
                    <div class="tree-leaf-content isLeaf" id="node-st-test" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Test.html">Test</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member-protected">
                    <div class="tree-leaf-content isLeaf" id="singleton-st-tests" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                            <span class="singleton-type"></span>
                            <a class="tree-leaf-text" href="ST.Tests.html">Tests</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="node-st-version" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.Version.html">Version</a>
                    </div>
                </div>
                <div class="tree-leaf tree-member">
                    <div class="tree-leaf-content isLeaf" id="node-st-watchdog" isLeaf="true">
                        <span class="tree-expando hidden">▸</span>
                                <span class="class-type"></span>
                            <a class="tree-leaf-text" href="ST.WatchDog.html">WatchDog</a>
                    </div>
                </div>
        </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-array" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="Array.html">Array</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-boolean" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="Boolean.html">Boolean</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-date" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="Date.html">Date</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-function" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="Function.html">Function</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-number" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="Number.html">Number</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-object" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="Object.html">Object</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-regexp" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="RegExp.html">RegExp</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-string" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="String.html">String</a>
    </div>
</div>

                    <div class="fa fa-plus toggle-tree hide tooltip tooltip-tr-br" data-expand="Expand All Classes" data-collapse="Collapse All Classes"><div class="callout callout-b"></div></div>
                </div>
                <div id="guide-tree" class="hide is-tree">
                    <div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-product_overview" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/product_overview.html">Sencha Test 概述</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-sencha_test_installation" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/sencha_test_installation.html">安装和配置</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-getting_started" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/getting_started.html">入门</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-testing_existing_apps" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/testing_existing_apps.html">测试已有应用程序</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-testing_applications" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/testing_applications.html">测试新建应用程序</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-command_line_archive_server" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/command_line_archive_server.html">命令行工具CLI和归档服务器</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-test_projects_scenarios_suites" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/test_projects_scenarios_suites.html">项目, 场景(Scenarios)和套件(Suites)</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-using_the_test_runner" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/using_the_test_runner.html">使用Test Runner</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-unit_functional_tests" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/unit_functional_tests.html">单元测试 vs 功能测试</a>
    </div>
</div>
<div class="tree-leaf tree-member">
    <div class="tree-leaf-content isLeaf" id="node-release_notes" isLeaf="true">
        <span class="tree-expando hidden">▸</span>
                <span class="class-type"></span>
            <a class="tree-leaf-text" href="guides/release_notes.html">发布说明</a>
    </div>
</div>

                    <div class="fa fa-plus toggle-tree hide tooltip tooltip-tr-br" data-expand="Expand All Guides" data-collapse="Collapse All Guides"><div class="callout callout-b"></div></div>
                </div>
            </div>
        </div>
        <a href="#" id="back-to-top">top </a>
        <div id="rightMembers" class="">
            
            
            <div id="member-toolbars">
    <div id="member-class-name">
            <span class='class-icon'></span>

        <h1 class='class'><a href="src/String.js.html#String" target="_blank">String</a>
        </h1>
    </div>
</div>
<div class="context-menu-ct">
    <div class="context-header">
        <div id="hide-context-menu" class="fa fa-caret-right"></div>
    </div>
    <div class="search">
        <form autocomplete="off">
            <input type="text" type="search" placeholder="search" id="searchtext">
            <i id="filtersubmit" class="fa fa-search"></i>
            <span id="help-btn" data-tip="Docs Help" class="tooltip tooltip-tr-br"><div class="callout callout-b"></div></span>
        </form>
    </div>
    <div class="context-menu-tabs">
        <div id="filterTab" class="toolbarHeaderButton active-tab">
            Filters
        </div>
        <div id="relatedClassesTab" class="toolbarHeaderButton">
            Related Classes
        </div>
    </div>
    <div id="filters-ct">
        <div id="toolbar">
            <div class="memberFilter">
                <input placeholder="Filter members..." type="search" id="member-filter-field" name="member-filter-field">
                <div id="toggleExamples" class="fa fa-code tooltip tooltip-tr-br" data-expand="Expand All Examples" data-collapse="Collapse All Examples"><div class="callout callout-b"></div></div>
                <div id="toggleAll" class="fa fa-plus tooltip tooltip-tr-br" data-expand="Expand All Members" data-collapse="Collapse All Members"><div class="callout callout-b"></div></div>
            </div>
            <div id="member-display">
                <div class="member-access-display"><label><input id="publicCheckbox" type="checkbox" value="member-public" checked=true/>Public</label></div>
                <div class="member-access-display"><label><input id="protectedCheckbox" type="checkbox" value="member-protected" checked=true/>Protected</label></div>
                <div class="member-access-display"><label><input id="privateCheckbox" type="checkbox" value="member-private" checked=true/>Private</label></div>
                <div class="member-access-display"><label><input id="inheritedCheckbox" type="checkbox" value="member-inherited" checked=true/>Inherited</label></div>
            </div>
            <div id="member-types-menu" class="member-types-menu">
                    <a href="#properties" id="properties-button-link"><div id="properties-nav-btn" class="toolbarButton disabled">
                        <i class="fa fa-book"></i>
                        <span class="member-type-btn-text">properties</span>
                        <div id="properties-count" class="nav-btn-count"></div>
                        <div class="nav-btn-mask"></div>
                    </div></a>
                    <a href="#methods" id="methods-button-link"><div id="methods-nav-btn" class="toolbarButton disabled">
                        <i class="fa fa-object-group"></i>
                        <span class="member-type-btn-text">methods</span>
                        <div id="methods-count" class="nav-btn-count"></div>
                        <div class="nav-btn-mask"></div>
                    </div></a>
            </div>
        </div>
    </div>
    <div id="related-classes-context-ct" class="hide">
        <!-- We'll programmatically copy in the related classes elements here on page load -->
    </div>
</div>
<div id="class-body-wrap" class="class-body-wrap">
    <div class="body-wrap-inner">
        <div id="classText" class="classText">
            <div class="classHead">
                <div class="classMeta">
                        <div class="classMetaColumn">
                            <h3>Hierarchy</h3>
                            <div class="list"><div class="hierarchy">String</div></div>
                        </div>
                </div>
            </div>
                <h2>Summary</h2>
                <p><a href='String.html'>String</a> is a global object that may be used to construct String instances.</p>
<p>String objects may be created by calling the constructor <code>new String()</code>. The <a href='String.html'>String</a> object wraps
JavaScript&#39;s string primitive data type with the methods described below. The global function
<code>String()</code> can also be called without new in front to create a primitive string. String literals in
JavaScript are primitive strings.</p>
<p>Because JavaScript automatically converts between string primitives and String objects, you can call
any of the methods of the <a href='String.html'>String</a> object on a string primitive. JavaScript automatically converts the
string primitive to a temporary <a href='String.html'>String</a> object, calls the method, then discards the temporary String
object. For example, you can use the <code>String.length</code> property on a string primitive created from a
string literal:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">s_obj = new String(s_prim = s_also_prim = &quot;foo&quot;);

s_obj.length;       // 3
s_prim.length;      // 3
s_also_prim.length; // 3
&#39;foo&#39;.length;       // 3
&quot;foo&quot;.length;       // 3
</code></pre></div><p>(A string literal is denoted with single or double quotation marks.)</p>
<p>String objects can be converted to primitive strings with the <a href='#method-valueOf'>valueOf</a> method.</p>
<p>String primitives and String objects give different results when evaluated as JavaScript. Primitives
are treated as source code; String objects are treated as a character sequence object. For example:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">s1 = &quot;2 + 2&quot;;               // creates a string primitive
s2 = new String(&quot;2 + 2&quot;);   // creates a String object
eval(s1);                   // returns the number 4
eval(s2);                   // returns the string &quot;2 + 2&quot;
eval(s2.valueOf());         // returns the number 4
</code></pre></div><h1 id="string_character-access">Character access<a class="quick-link" href="#string_character-access"></a></h1>
<p>There are two ways to access an individual character in a string. The first is the <a href='#method-charAt'>charAt</a> method:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">return &#39;cat&#39;.charAt(1); // returns &quot;a&quot;
</code></pre></div><p>The other way is to treat the string as an array, where each index corresponds to an individual
character:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">return &#39;cat&#39;[1]; // returns &quot;a&quot;
</code></pre></div><p>The second way (treating the string as an array) is not part of ECMAScript 3. It is a JavaScript and
ECMAScript 5 feature.</p>
<p>In both cases, attempting to set an individual character won&#39;t work. Trying to set a character
through <a href='#method-charAt'>charAt</a> results in an error, while trying to set a character via indexing does not throw an
error, but the string itself is unchanged.</p>
<h1 id="string_comparing-strings">Comparing strings<a class="quick-link" href="#string_comparing-strings"></a></h1>
<p>C developers have the <code>strcmp()</code> function for comparing strings. In JavaScript, you just use the less-
than and greater-than operators:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var a = &quot;a&quot;;
var b = &quot;b&quot;;
if (a &lt; b) // true
    print(a + &quot; is less than &quot; + b);
else if (a &gt; b)
    print(a + &quot; is greater than &quot; + b);
else
    print(a + &quot; and &quot; + b + &quot; are equal.&quot;);
</code></pre></div><p>A similar result can be achieved using the <a href='#method-localeCompare'>localeCompare</a> method inherited by <a href='String.html'>String</a> instances.</p>
<div class="notice">
Documentation for this class comes from <a href="../../https@developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="external-link" target="_blank">MDN</a>
and is available under <a href="../../creativecommons.org/licenses/by-sa/2.0/" class="external-link" target="_blank">Creative Commons: Attribution-Sharealike license</a>.
</div>

        </div>
        <div class="no-visible-members-warning">No members found using the current filters</div>
        <div class="members">
                <div id="properties-ct">
                    <h2 id="properties" class="type">properties</h2>
                    <a name="properties"></a>
                          
                            <div id="property-length" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="length" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-property-length">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#property-length" class="member-name-link"><span data-ref="property-length" class="member-name">length</span></a>
            

                : <span class="memberType"><a href='Number.html'>Number</a></span>
            <div class="member-tags">
            </div>
        </h2>

            <p>Reflects the length of the string.</p>
<p>This property returns the number of code units in the string. UTF-16, the string format used by JavaScript, uses a single 16-bit
code unit to represent the most common characters, but needs to use two code units for less commonly-used characters, so it&#39;s
possible for the value returned by <a href='#property-length'>length</a> to not match the actual number of characters in the string.</p>
<p>For an empty string, <a href='#property-length'>length</a> is 0.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var x = &quot;Netscape&quot;;
var empty = &quot;&quot;;

console.log(&quot;Netspace is &quot; + x.length + &quot; code units long&quot;);
console.log(&quot;The empty string is has a length of &quot; + empty.length); // should be 0
</code></pre></div>
    </div>
  
                          
                </div>
                <div id="methods-ct">
                    <h2 id="methods" class="type">methods</h2>
                    <a name="methods"></a>
                            <div id="method-charAt" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="charAt" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-charAt">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-charAt" class="member-name-link"><span data-ref="method-charAt" class="member-name">charAt</span></a>
            <span class="params-list"> (
                        
                        index
                            

                )</span>

                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the character at the specified index.</p>
<p>Characters in a string are indexed from left to right. The index of the first character is 0, and
the index of the last character in a string called <code>stringName</code> is <code>stringName.length - 1</code>. If the
index you supply is out of range, JavaScript returns an empty string.</p>
<p>The following example displays characters at different locations in the string &quot;Brave new world&quot;:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var anyString=&quot;Brave new world&quot;;

document.writeln(&quot;The character at index 0 is &#39;&quot; + anyString.charAt(0) + &quot;&#39;&quot;);
document.writeln(&quot;The character at index 1 is &#39;&quot; + anyString.charAt(1) + &quot;&#39;&quot;);
document.writeln(&quot;The character at index 2 is &#39;&quot; + anyString.charAt(2) + &quot;&#39;&quot;);
document.writeln(&quot;The character at index 3 is &#39;&quot; + anyString.charAt(3) + &quot;&#39;&quot;);
document.writeln(&quot;The character at index 4 is &#39;&quot; + anyString.charAt(4) + &quot;&#39;&quot;);
document.writeln(&quot;The character at index 999 is &#39;&quot; + anyString.charAt(999) + &quot;&#39;&quot;);
</code></pre></div><p>These lines display the following:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">The character at index 0 is &#39;B&#39;
The character at index 1 is &#39;r&#39;
The character at index 2 is &#39;a&#39;
The character at index 3 is &#39;v&#39;
The character at index 4 is &#39;e&#39;
The character at index 999 is &#39;&#39;
</code></pre></div><p>The following provides a means of ensuring that going through a string loop always provides a whole
character, even if the string contains characters that are not in the Basic Multi-lingual Plane.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var str = &#39;A\uD87E\uDC04Z&#39;; // We could also use a non-BMP character directly
for (var i=0, chr; i &lt; str.length; i++) {
    if ((chr = getWholeChar(str, i)) === false) {continue;} // Adapt this line at the top of
</code></pre></div><p>each loop, passing in the whole string and the current iteration and returning a variable to
represent the individual character
        alert(chr);
    }</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function getWholeChar (str, i) {
    var code = str.charCodeAt(i);

    if (isNaN(code)) {
    return &#39;&#39;; // Position not found
    }
    if (code &lt; 0xD800 || code &gt; 0xDFFF) {
        return str.charAt(i);
    }
    if (0xD800 &lt;= code &amp;&amp; code &lt;= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F
</code></pre></div><p>to treat high private surrogates as single characters)
        if (str.length &lt;= (i+1))  {
            throw &#39;High surrogate without following low surrogate&#39;;
        }
        var next = str.charCodeAt(i+1);
        if (0xDC00 &gt; next || next &gt; 0xDFFF) {
            throw &#39;High surrogate without following low surrogate&#39;;
        }
        return str.charAt(i)+str.charAt(i+1);
    }
    // Low surrogate (0xDC00 &lt;= code &amp;&amp; code &lt;= 0xDFFF)
    if (i === 0) {
        throw &#39;Low surrogate without preceding high surrogate&#39;;
    }
    var prev = str.charCodeAt(i-1);
    if (0xD800 &gt; prev || prev &gt; 0xDBFF) { // (could change last hex to 0xDB7F to treat high private
surrogates as single characters)
      throw &#39;Low surrogate without preceding high surrogate&#39;;
    }
    return false; // We can pass over low surrogates now as the second component in a pair which we
have already processed
}</p>
<p>While the second example may be more frequently useful for those wishing to support non-BMP
characters (since the above does not require the caller to know where any non-BMP character might
appear), in the event that one <em>does</em> wish, in choosing a character by index, to treat the surrogate
pairs within a string as the single characters they represent, one can use the following:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function fixedCharAt (str, idx) {
    var ret = &#39;&#39;;
    str += &#39;&#39;;
    var end = str.length;

    var surrogatePairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
    while ((surrogatePairs.exec(str)) != null) {
        var li = surrogatePairs.lastIndex;
        if (li - 2 &lt; idx) {
            idx++;
        }
        else {
        break;
    }
}

if (idx &gt;= end || idx &lt; 0) {
    return &#39;&#39;;
}

ret += str.charAt(idx);

if (/[\uD800-\uDBFF]/.test(ret) &amp;&amp; /[\uDC00-\uDFFF]/.test(str.charAt(idx+1))) {
    ret += str.charAt(idx+1); // Go one further, since one of the &quot;characters&quot; is part of a
</code></pre></div><p>surrogate pair
    }
    return ret;
    }</p>

            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-charAt--index">index</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>An integer between 0 and 1 less than the length of the string.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Individual character from string.</p>
</div>

    </div>
  
                            <div id="method-charCodeAt" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="charCodeAt" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-charCodeAt">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-charCodeAt" class="member-name-link"><span data-ref="method-charCodeAt" class="member-name">charCodeAt</span></a>
            <span class="params-list"> (
                        
                        index
                            

                )</span>

                :
                    <span class="memberType"><a href='Number.html'>Number</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns a number indicating the Unicode value of the character at the given index.</p>
<p>Unicode code points range from 0 to 1,114,111. The first 128 Unicode code points are a direct match
of the ASCII character encoding.</p>
<p>Note that <a href='#method-charCodeAt'>charCodeAt</a> will always return a value that is less than 65,536. This is because the
higher code points are represented by a pair of (lower valued) &quot;surrogate&quot; pseudo-characters which
are used to comprise the real character. Because of this, in order to examine or reproduce the full
character for individual characters of value 65,536 and above, for such characters, it is necessary
to retrieve not only <code>charCodeAt(i)</code>, but also <code>charCodeAt(i+1)</code> (as if examining/reproducing a
string with two letters). See example 2 and 3 below.</p>
<p><a href='#method-charCodeAt'>charCodeAt</a> returns <code>NaN</code> if the given index is not greater than 0 or is greater than the length of
the string.</p>
<p>Backward Compatibility with JavaScript 1.2</p>
<p>The <a href='#method-charCodeAt'>charCodeAt</a> method returns a number indicating the ISO-Latin-1 codeset value of the character
at the given index. The ISO-Latin-1 codeset ranges from 0 to 255. The first 0 to 127 are a direct
match of the ASCII character set.</p>
<p>Example 1: Using <a href='#method-charCodeAt'>charCodeAt</a></p>
<p>The following example returns 65, the Unicode value for A.</p>
<p>   &quot;ABC&quot;.charCodeAt(0) // returns 65</p>
<p>Example 2: Fixing <a href='#method-charCodeAt'>charCodeAt</a> to handle non-Basic-Multilingual-Plane characters if their presence
earlier in the string is unknown</p>
<p>This version might be used in for loops and the like when it is unknown whether non-BMP characters
exist before the specified index position.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function fixedCharCodeAt (str, idx) {
    // ex. fixedCharCodeAt (&#39;\uD800\uDC00&#39;, 0); // 65536
    // ex. fixedCharCodeAt (&#39;\uD800\uDC00&#39;, 1); // 65536
    idx = idx || 0;
    var code = str.charCodeAt(idx);
    var hi, low;
    if (0xD800 &lt;= code &amp;&amp; code &lt;= 0xDBFF) { // High surrogate (could change last hex to 0xDB7F to treat high private surrogates as single characters)
        hi = code;
        low = str.charCodeAt(idx+1);
        if (isNaN(low)) {
            throw &#39;High surrogate not followed by low surrogate in fixedCharCodeAt()&#39;;
        }
        return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;
    }
    if (0xDC00 &lt;= code &amp;&amp; code &lt;= 0xDFFF) { // Low surrogate
    // We return false to allow loops to skip this iteration since should have already handled
</code></pre></div><p>high surrogate above in the previous iteration
            return false;
        }
        return code;
    }</p>
<p>Example 3: Fixing <a href='#method-charCodeAt'>charCodeAt</a> to handle non-Basic-Multilingual-Plane characters if their presence
earlier in the string is known</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function knownCharCodeAt (str, idx) {
    str += &#39;&#39;;
    var code,
    end = str.length;

    var surrogatePairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
    while ((surrogatePairs.exec(str)) != null) {
        var li = surrogatePairs.lastIndex;
        if (li - 2 &lt; idx) {
            idx++;
        }
        else {
            break;
        }
    }

    if (idx &gt;= end || idx &lt; 0) {
        return NaN;
    }

    code = str.charCodeAt(idx);

    var hi, low;
    if (0xD800 &lt;= code &amp;&amp; code &lt;= 0xDBFF) {
        hi = code;
        low = str.charCodeAt(idx+1); // Go one further, since one of the &quot;characters&quot; is part of
</code></pre></div><p>a surrogate pair
            return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;
        }
        return code;
    }</p>

            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-charCodeAt--index">index</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>An integer greater than 0 and less than the length of the string; if it is
not a number, it defaults to 0.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='Number.html'>Number</a></span>
                <div class="return-desc"><p>Value between 0 and 65535.</p>
</div>

    </div>
  
                            <div id="method-concat" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="concat" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-concat">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-concat" class="member-name-link"><span data-ref="method-concat" class="member-name">concat</span></a>
            <span class="params-list"> (
                        
                        strings
                            

                )</span>

                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Combines combines the text from one or more strings and returns a new string. Changes to the text in
one string do not affect the other string.</p>
<p>The following example combines strings into a new string.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var hello = &quot;Hello, &quot;;
console.log(hello.concat(&quot;Kevin&quot;, &quot; have a nice day.&quot;)); // Hello, Kevin have a nice day.
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-concat--strings">strings</span> :
                            <span class="memberType">&nbsp;<a href='String.html'>String...</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The strings to concatenate.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Result of both strings.</p>
</div>

    </div>
  
                            <div id="method-constructor" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="constructor" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-constructor">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-constructor" class="member-name-link"><span data-ref="method-constructor" class="member-name">constructor</span></a>
            <span class="params-list"> (
                        
                        value
                            

                )</span>


            <div class="member-tags">
            </div>
        </h2>

            <p>Creates new String object.</p>

            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-constructor--value">value</span> :
                            <span class="memberType">&nbsp;<a href='Object.html'>Object</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The value to wrap into String object.</p>
</div>

                </div>

    </div>
  
                            <div id="method-fromCharCode" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="fromCharCode" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-fromCharCode">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-fromCharCode" class="member-name-link"><span data-ref="method-fromCharCode" class="member-name">fromCharCode</span></a>
            <span class="params-list"> (
                        
                        numbers
                            

                )</span>

                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns a string created by using the specified sequence of Unicode values.</p>
<p>This method returns a string and not a <a href='String.html'>String</a> object.</p>
<p>Because <a href='#method-fromCharCode'>fromCharCode</a> is a static method of <a href='String.html'>String</a>, you always use it as <code>String.fromCharCode()</code>,
rather than as a method of a <a href='String.html'>String</a> object you created.</p>
<p>Although most common Unicode values can be represented in a fixed width system/with one number (as
expected early on during JavaScript standardization) and <code>fromCharCode()</code> can be used to return a
single character for the most common values (i.e., UCS-2 values which are the subset of UTF-16 with
the most common characters), in order to deal with ALL legal Unicode values, <code>fromCharCode()</code> alone
is inadequate. Since the higher code point characters use two (lower value) &quot;surrogate&quot; numbers to
form a single character, <code>fromCharCode()</code> can be used to return such a pair and thus adequately
represent these higher valued characters.</p>
<p>Be aware, therefore, that the following utility function to grab the accurate character even for
higher value code points, may be returning a value which is rendered as a single character, but
which has a string count of two (though usually the count will be one).</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">// String.fromCharCode() alone cannot get the character at such a high code point
// The following, on the other hand, can return a 4-byte character as well as the
//   usual 2-byte ones (i.e., it can return a single character which actually has
//   a string length of 2 instead of 1!)
alert(fixedFromCharCode(0x2F804)); // or 194564 in decimal

function fixedFromCharCode (codePt) {
    if (codePt &gt; 0xFFFF) {
        codePt -= 0x10000;
        return String.fromCharCode(0xD800 + (codePt &gt;&gt; 10), 0xDC00 +
        (codePt &amp; 0x3FF));
    }
    else {
        return String.fromCharCode(codePt);
    }
}
</code></pre></div><p>The following example returns the string &quot;ABC&quot;.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">String.fromCharCode(65,66,67)
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-fromCharCode--numbers">numbers</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number...</a></span>
                        
                    </p>
                    <div class="params-desc"><p>A sequence of numbers that are Unicode values.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>String containing characters from encoding.</p>
</div>

    </div>
  
                          
                            <div id="method-indexOf" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="indexOf" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-indexOf">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-indexOf" class="member-name-link"><span data-ref="method-indexOf" class="member-name">indexOf</span></a>
            <span class="params-list"> (
                        
                        searchValue
                        , 
                        fromIndex
                            

                )</span>

                :
                    <span class="memberType"><a href='Number.html'>Number</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the index within the calling <a href='String.html'>String</a> object of the first occurrence of the specified value,
or -1 if not found.</p>
<p>Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character
of a string called <code>stringName</code> is <code>stringName.length - 1</code>.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">&quot;Blue Whale&quot;.indexOf(&quot;Blue&quot;)    // returns 0
&quot;Blue Whale&quot;.indexOf(&quot;Blute&quot;)   // returns -1
&quot;Blue Whale&quot;.indexOf(&quot;Whale&quot;,0) // returns 5
&quot;Blue Whale&quot;.indexOf(&quot;Whale&quot;,5) // returns 5
&quot;Blue Whale&quot;.indexOf(&quot;&quot;,9)      // returns 9
&quot;Blue Whale&quot;.indexOf(&quot;&quot;,10)     // returns 10
&quot;Blue Whale&quot;.indexOf(&quot;&quot;,11)     // returns 10
</code></pre></div><p>The <a href='#method-indexOf'>indexOf</a> method is case sensitive. For example, the following expression returns -1:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">&quot;Blue Whale&quot;.indexOf(&quot;blue&quot;)
</code></pre></div><p>Note that &#39;0&#39; doesn&#39;t evaluate to true and &#39;-1&#39; doesn&#39;t evaluate to false. Therefore, when checking if a specific string exists
within another string the correct way to check would be:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">&quot;Blue Whale&quot;.indexOf(&quot;Blue&quot;) != -1 // true
&quot;Blue Whale&quot;.indexOf(&quot;Bloe&quot;) != -1 // false
</code></pre></div><p>The following example uses indexOf and lastIndexOf to locate values in the string &quot;Brave new world&quot;.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var anyString=&quot;Brave new world&quot;

document.write(&quot;&lt;P&gt;The index of the first w from the beginning is &quot; + anyString.indexOf(&quot;w&quot;))          // Displays 8
document.write(&quot;&lt;P&gt;The index of the first w from the end is &quot; + anyString.lastIndexOf(&quot;w&quot;))      // Displays 10
document.write(&quot;&lt;P&gt;The index of &#39;new&#39; from the beginning is &quot; + anyString.indexOf(&quot;new&quot;))        // Displays 6
document.write(&quot;&lt;P&gt;The index of &#39;new&#39; from the end is &quot; + anyString.lastIndexOf(&quot;new&quot;))    // Displays 6
</code></pre></div><p>The following example defines two string variables. The variables contain the same string except that the second string contains
uppercase letters. The first <code>writeln</code> method displays 19. But because the <a href='#method-indexOf'>indexOf</a> method is case sensitive, the string
&quot;cheddar&quot; is not found in <code>myCapString</code>, so the second <code>writeln</code> method displays -1.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">myString=&quot;brie, pepper jack, cheddar&quot;
myCapString=&quot;Brie, Pepper Jack, Cheddar&quot;
document.writeln(&#39;myString.indexOf(&quot;cheddar&quot;) is &#39; + myString.indexOf(&quot;cheddar&quot;))
document.writeln(&#39;&lt;P&gt;myCapString.indexOf(&quot;cheddar&quot;) is &#39; + myCapString.indexOf(&quot;cheddar&quot;))
</code></pre></div><p>The following example sets count to the number of occurrences of the letter x in the string str:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">count = 0;
pos = str.indexOf(&quot;x&quot;);
while ( pos != -1 ) {
    count++;
    pos = str.indexOf(&quot;x&quot;,pos+1);
}
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-indexOf--searchValue">searchValue</span> :
                            <span class="memberType">&nbsp;<a href='String.html'>String</a></span>
                        
                    </p>
                    <div class="params-desc"><p>A string representing the value to search for.</p>
</div>

                </div>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-indexOf--fromIndex">fromIndex</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The location within the calling string to start the search from. It can be any integer between 0 and
the length of the string. The default value is 0.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='Number.html'>Number</a></span>
                <div class="return-desc"><p>Position of specified value or -1 if not found.</p>
</div>

    </div>
  
                          
                            <div id="method-lastIndexOf" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="lastIndexOf" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-lastIndexOf">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-lastIndexOf" class="member-name-link"><span data-ref="method-lastIndexOf" class="member-name">lastIndexOf</span></a>
            <span class="params-list"> (
                        
                        searchValue
                        , 
                        fromIndex
                            

                )</span>

                :
                    <span class="memberType"><a href='Number.html'>Number</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the index within the calling String object of the last occurrence of
the specified value, or -1 if not found. The calling string is searched
backward, starting at fromIndex.</p>
<p>Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character
is <code>stringName.length - 1</code>.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">&quot;canal&quot;.lastIndexOf(&quot;a&quot;)   // returns 3
&quot;canal&quot;.lastIndexOf(&quot;a&quot;,2) // returns 1
&quot;canal&quot;.lastIndexOf(&quot;a&quot;,0) // returns -1
&quot;canal&quot;.lastIndexOf(&quot;x&quot;)   // returns -1
</code></pre></div><p>The <a href='#method-lastIndexOf'>lastIndexOf</a> method is case sensitive. For example, the following expression returns -1:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">&quot;Blue Whale, Killer Whale&quot;.lastIndexOf(&quot;blue&quot;)
</code></pre></div><p>The following example uses <a href='#method-indexOf'>indexOf</a> and <a href='#method-lastIndexOf'>lastIndexOf</a> to locate values in the string &quot;<code>Brave new world</code>&quot;.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var anyString=&quot;Brave new world&quot;

// Displays 8
document.write(&quot;&lt;P&gt;The index of the first w from the beginning is &quot; +
anyString.indexOf(&quot;w&quot;))
// Displays 10
document.write(&quot;&lt;P&gt;The index of the first w from the end is &quot; +
anyString.lastIndexOf(&quot;w&quot;))
// Displays 6
document.write(&quot;&lt;P&gt;The index of &#39;new&#39; from the beginning is &quot; +
anyString.indexOf(&quot;new&quot;))
// Displays 6
document.write(&quot;&lt;P&gt;The index of &#39;new&#39; from the end is &quot; +
anyString.lastIndexOf(&quot;new&quot;))
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-lastIndexOf--searchValue">searchValue</span> :
                            <span class="memberType">&nbsp;<a href='String.html'>String</a></span>
                        
                    </p>
                    <div class="params-desc"><p>A string representing the value to search for.</p>
</div>

                </div>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-lastIndexOf--fromIndex">fromIndex</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The location within the calling string to start the search from, indexed from left to right. It can
be any integer between 0 and the length of the string. The default value is the length of the string.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='Number.html'>Number</a></span>
                <div class="return-desc"></div>

    </div>
  
                            <div id="method-localeCompare" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="localeCompare" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-localeCompare">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-localeCompare" class="member-name-link"><span data-ref="method-localeCompare" class="member-name">localeCompare</span></a>
            <span class="params-list"> (
                        
                        compareString
                            

                )</span>

                :
                    <span class="memberType"><a href='Number.html'>Number</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns a number indicating whether a reference string comes before or after or is the same as the
given string in sort order.</p>
<p>Returns a number indicating whether a reference string comes before or after or is the same as the
given string in sort order. Returns -1 if the string occurs earlier in a sort than <code>compareString</code>,
returns 1 if the string occurs afterwards in such a sort, and returns 0 if they occur at the same
level.</p>
<p>The following example demonstrates the different potential results for a string occurring before,
after, or at the same level as another:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">alert(&#39;a&#39;.localeCompare(&#39;b&#39;)); // -1
alert(&#39;b&#39;.localeCompare(&#39;a&#39;)); // 1
alert(&#39;b&#39;.localeCompare(&#39;b&#39;)); // 0
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-localeCompare--compareString">compareString</span> :
                            <span class="memberType">&nbsp;<a href='String.html'>String</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The string against which the referring string is comparing.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='Number.html'>Number</a></span>
                <div class="return-desc"><p>Returns -1 if the string occurs earlier in a sort than
compareString, returns 1 if the string occurs afterwards in such a sort, and
returns 0 if they occur at the same level.</p>
</div>

    </div>
  
                            <div id="method-match" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="match" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-match">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-match" class="member-name-link"><span data-ref="method-match" class="member-name">match</span></a>
            <span class="params-list"> (
                        
                        regexp
                            

                )</span>

                :
                    <span class="memberType"><a href='Array.html'>Array</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Used to match a regular expression against a string.</p>
<p>If the regular expression does not include the <code>g</code> flag, returns the same result as <code>regexp.exec(string)</code>.</p>
<p>If the regular expression includes the <code>g</code> flag, the method returns an Array containing all matches. If there were no matches,
the method returns <code>null</code>.</p>
<p>The returned <a href='Array.html'>Array</a> has an extra <code>input</code> property, which contains the regexp that generated it as a result. In addition,
it has an <code>index</code> property, which represents the zero-based index of the match in the string.</p>
<p>In the following example, <a href='#method-match'>match</a> is used to find &quot;Chapter&quot; followed by 1 or more numeric characters followed by a decimal point
and numeric character 0 or more times. The regular expression includes the <code>i</code> flag so that case will be ignored.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">str = &quot;For more information, see Chapter 3.4.5.1&quot;;
re = /(chapter \d+(\.\d)*)/i;
found = str.match(re);
document.write(found);
</code></pre></div><p>This returns the array containing Chapter 3.4.5.1,Chapter 3.4.5.1,.1</p>
<p>&quot;<code>Chapter 3.4.5.1</code>&quot; is the first match and the first value remembered from <code>(Chapter \d+(\.\d)*)</code>.</p>
<p>&quot;<code>.1</code>&quot; is the second value remembered from <code>(\.\d)</code>.</p>
<p>The following example demonstrates the use of the global and ignore case flags with <a href='#method-match'>match</a>. All letters A through E and a
through e are returned, each its own element in the array</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var str = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&quot;;
var regexp = /[A-E]/gi;
var matches_array = str.match(regexp);
document.write(matches_array);
</code></pre></div><p><code>matches_array</code> now equals <code>[&#39;A&#39;, &#39;B&#39;, &#39;C&#39;, &#39;D&#39;, &#39;E&#39;, &#39;a&#39;, &#39;b&#39;, &#39;c&#39;, &#39;d&#39;, &#39;e&#39;]</code>.</p>

            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-match--regexp">regexp</span> :
                            <span class="memberType">&nbsp;<a href='RegExp.html'>RegExp</a></span>
                        
                    </p>
                    <div class="params-desc"><p>A <a href='RegExp.html'>RegExp</a> object. If a non-RegExp object <code>obj</code> is passed, it is
implicitly converted to a RegExp by using <code>new RegExp(obj)</code>.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='Array.html'>Array</a></span>
                <div class="return-desc"><p>Contains results of the match (if any).</p>
</div>

    </div>
  
                          
                            <div id="method-replace" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="replace" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-replace">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-replace" class="member-name-link"><span data-ref="method-replace" class="member-name">replace</span></a>
            <span class="params-list"> (
                        
                        pattern
                        , 
                        replacement
                            

                )</span>

                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Used to find a match between a regular expression and a string, and to replace the matched substring
with a new substring.</p>
<p>This method does not change the <a href='String.html'>String</a> object it is called on. It simply returns a new string.</p>
<p>To perform a global search and replace, either include the <code>g</code> flag in the regular expression or if
the first parameter is a string, include <code>g</code> in the flags parameter.</p>
<p>The replacement string can include the following special replacement patterns:</p>
<table>
<thead>
<tr>
<th style="text-align:left">Pattern</th>
<th style="text-align:left">Inserts</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>$$</code></td>
<td style="text-align:left">Inserts a <code>$</code>.</td>
</tr>
<tr>
<td style="text-align:left"><code>$&amp;</code></td>
<td style="text-align:left">Inserts the matched substring.</td>
</tr>
<tr>
<td style="text-align:left">`$``</td>
<td style="text-align:left">Inserts the portion of the string that precedes the matched substring.</td>
</tr>
<tr>
<td style="text-align:left"><code>$&#39;</code></td>
<td style="text-align:left">Inserts the portion of the string that follows the matched substring.</td>
</tr>
<tr>
<td style="text-align:left"><code>$n</code> or <code>$nn</code></td>
<td style="text-align:left">Where <code>n</code> or <code>nn</code> are decimal digits, inserts the _n_th parenthesized submatch string, provided the first</td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">argument was a <a href='RegExp.html'>RegExp</a> object.</td>
</tr>
</tbody>
</table>
<p>You can specify a function as the second parameter. In this case, the function will be invoked after the match has been
performed. The function&#39;s result (return value) will be used as the replacement string. (Note: the above-mentioned special
replacement patterns do not apply in this case.) Note that the function will be invoked multiple times for each full match to be
replaced if the regular expression in the first parameter is global.</p>
<p>The arguments to the function are as follows:</p>
<table>
<thead>
<tr>
<th style="text-align:left">Possible Name</th>
<th style="text-align:left">Supplied Value</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>str</code></td>
<td style="text-align:left">The matched substring. (Corresponds to <code>$&amp;</code> above.)</td>
</tr>
<tr>
<td style="text-align:left"><code>p1, p2, ...</code></td>
<td style="text-align:left">The _n_th parenthesized submatch string, provided the first argument to replace was a <a href='RegExp.html'>RegExp</a> object.</td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">(Correspond to $1, $2, etc. above.)</td>
</tr>
<tr>
<td style="text-align:left"><code>offset</code></td>
<td style="text-align:left">The offset of the matched substring within the total string being examined. (For example, if the total string</td>
</tr>
<tr>
<td style="text-align:left"></td>
<td style="text-align:left">was &quot;<code>abcd</code>&quot;, and the matched substring was &quot;<code>bc</code>&quot;, then this argument will be 1.)</td>
</tr>
<tr>
<td style="text-align:left"><code>s</code></td>
<td style="text-align:left">The total string being examined.</td>
</tr>
</tbody>
</table>
<p>(The exact number of arguments will depend on whether the first argument was a <a href='RegExp.html'>RegExp</a> object and, if so, how many parenthesized
submatches it specifies.)</p>
<p>The following example will set <code>newString</code> to &quot;<code>XXzzzz - XX , zzzz</code>&quot;:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function replacer(str, p1, p2, offset, s)
{
    return str + &quot; - &quot; + p1 + &quot; , &quot; + p2;
}
var newString = &quot;XXzzzz&quot;.replace(/(X*)(z*)/, replacer);
</code></pre></div><p>In the following example, the regular expression includes the global and ignore case flags which permits replace to replace each
occurrence of &#39;apples&#39; in the string with &#39;oranges&#39;.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var re = /apples/gi;
var str = &quot;Apples are round, and apples are juicy.&quot;;
var newstr = str.replace(re, &quot;oranges&quot;);
print(newstr);
</code></pre></div><p>In this version, a string is used as the first parameter and the global and ignore case flags are specified in the flags
parameter.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var str = &quot;Apples are round, and apples are juicy.&quot;;
var newstr = str.replace(&quot;apples&quot;, &quot;oranges&quot;, &quot;gi&quot;);
print(newstr);
</code></pre></div><p>Both of these examples print &quot;oranges are round, and oranges are juicy.&quot;</p>
<p>In the following example, the regular expression is defined in replace and includes the ignore case flag.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var str = &quot;Twas the night before Xmas...&quot;;
var newstr = str.replace(/xmas/i, &quot;Christmas&quot;);
print(newstr);
</code></pre></div><p>This prints &quot;Twas the night before Christmas...&quot;</p>
<p>The following script switches the words in the string. For the replacement text, the script uses the $1 and $2 replacement
patterns.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var re = /(\w+)\s(\w+)/;
var str = &quot;John Smith&quot;;
var newstr = str.replace(re, &quot;$2, $1&quot;);
print(newstr);
</code></pre></div><p>This prints &quot;Smith, John&quot;.</p>
<p>In this example, all occurrences of capital letters in the string are converted to lower case, and a hyphen is inserted just
before the match location. The important thing here is that additional operations are needed on the matched item before it is
given back as a replacement.</p>
<p>The replacement function accepts the matched snippet as its parameter, and uses it to transform the case and concatenate the
hyphen before returning.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function styleHyphenFormat(propertyName)
{
    function upperToHyphenLower(match)
    {
        return &#39;-&#39; + match.toLowerCase();
    }
    return propertyName.replace(/[A-Z]/, upperToHyphenLower);
}
</code></pre></div><p>Given <code>styleHyphenFormat(&#39;borderTop&#39;)</code>, this returns &#39;border-top&#39;.</p>
<p>Because we want to further transform the <em>result</em> of the match before the final substitution is made, we must use a function.
This forces the evaluation of the match prior to the <code>toLowerCase()</code> method. If we had tried to do this using the match without a
 function, the <code>toLowerCase()</code> would have no effect.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var newString = propertyName.replace(/[A-Z]/, &#39;-&#39; + &#39;$&amp;&#39;.toLowerCase());  // won&#39;t work
</code></pre></div><p>This is because <code>&#39;$&amp;&#39;.toLowerCase()</code> would be evaluated first as a string literal (resulting in the same <code>&#39;$&amp;&#39;</code>) before using the
characters as a pattern.</p>
<p>The following example replaces a Fahrenheit degree with its equivalent Celsius degree. The Fahrenheit degree should be a number
ending with F. The function returns the Celsius number ending with C. For example, if the input number is 212F, the function
 returns 100C. If the number is 0F, the function returns -17.77777777777778C.</p>
<p>The regular expression <code>test</code> checks for any number that ends with F. The number of Fahrenheit degree is accessible to the
function through its second parameter, <code>p1</code>. The function sets the Celsius number based on the Fahrenheit degree passed in a
string to the <code>f2c</code> function. <code>f2c</code> then returns the Celsius number. This function approximates Perl&#39;s <code>s///e</code> flag.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function f2c(x)
{
    function convert(str, p1, offset, s)
    {
        return ((p1-32) * 5/9) + &quot;C&quot;;
    }
    var s = String(x);
    var test = /(\d+(?:\.\d*)?)F\b/g;
    return s.replace(test, convert);
}
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-replace--pattern">pattern</span> :
                            <span class="memberType">&nbsp;<a href='String.html'>String</a> / <a href='RegExp.html'>RegExp</a></span>
                        
                    </p>
                    <div class="params-desc"><p>Either a string or regular expression pattern to search for.</p>
</div>

                </div>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-replace--replacement">replacement</span> :
                            <span class="memberType">&nbsp;<a href='String.html'>String</a> / <a href='Function.html'>Function</a></span>
                        
                    </p>
                    <div class="params-desc"><p>Either string or function:</p>
<ul>
<li>The String to replace the <code>pattern</code> with. Number of special replacement patterns are supported;
see the &quot;Specifying a string as a parameter&quot; section above.</li>
<li>A function to be invoked to create the replacement.
The arguments supplied to this function are described in the &quot;Specifying a function as a parameter&quot;
section above.</li>
</ul>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>String of matched replaced items.</p>
</div>

    </div>
  
                            <div id="method-search" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="search" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-search">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-search" class="member-name-link"><span data-ref="method-search" class="member-name">search</span></a>
            <span class="params-list"> (
                        
                        regexp
                            

                )</span>

                :
                    <span class="memberType"><a href='Number.html'>Number</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Executes the search for a match between a regular expression and a specified string.</p>
<p>If successful, search returns the index of the regular expression inside the string. Otherwise, it
returns -1.</p>
<p>When you want to know whether a pattern is found in a string use search (similar to the regular
expression <code>test</code> method); for more information (but slower execution) use <a href='#method-match'>match</a> (similar to the
regular expression <code>exec</code> method).</p>
<p>The following example prints a message which depends on the success of the test.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function testinput(re, str){
    if (str.search(re) != -1)
        midstring = &quot; contains &quot;;
    else
        midstring = &quot; does not contain &quot;;
    document.write (str + midstring + re);
}
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-search--regexp">regexp</span> :
                            <span class="memberType">&nbsp;<a href='RegExp.html'>RegExp</a></span>
                        
                    </p>
                    <div class="params-desc"><p>A regular expression object. If a non-RegExp object obj is passed, it is
implicitly converted to a RegExp by using <code>new RegExp(obj)</code>.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='Number.html'>Number</a></span>
                <div class="return-desc"><p>If successful, search returns the index of the regular
expression inside the string. Otherwise, it returns -1.</p>
</div>

    </div>
  
                            <div id="method-slice" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="slice" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-slice">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-slice" class="member-name-link"><span data-ref="method-slice" class="member-name">slice</span></a>
            <span class="params-list"> (
                        
                        beginSlice
                        , 
                        endSlice
                            

                )</span>

                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Extracts a section of a string and returns a new string.</p>
<p><a href='#method-slice'>slice</a> extracts the text from one string and returns a new string. Changes to the text in one
string do not affect the other string.</p>
<p><a href='#method-slice'>slice</a> extracts up to but not including <code>endSlice</code>. <code>string.slice(1,4)</code> extracts the second
character through the fourth character (characters indexed 1, 2, and 3).</p>
<p>As a negative index, <code>endSlice</code> indicates an offset from the end of the string. <code>string.slice(2,-1)</code>
extracts the third character through the second to last character in the string.</p>
<p>The following example uses slice to create a new string.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">// assumes a print function is defined
var str1 = &quot;The morning is upon us.&quot;;
var str2 = str1.slice(4, -2);
print(str2);
</code></pre></div><p>This writes:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">morning is upon u
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-slice--beginSlice">beginSlice</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The zero-based index at which to begin extraction.</p>
</div>

                </div>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-slice--endSlice">endSlice</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The zero-based index at which to end extraction. If omitted, <a href='#method-slice'>slice</a>
extracts to the end of the string.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>All characters from specified start up to (but excluding)
end.</p>
</div>

    </div>
  
                            <div id="method-split" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="split" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-split">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-split" class="member-name-link"><span data-ref="method-split" class="member-name">split</span></a>
            <span class="params-list"> (
                        
                        seperator
                        , 
                        limit
                            

                )</span>

                :
                    <span class="memberType"><a href='Array.html'>Array</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Splits a <a href='String.html'>String</a> object into an array of strings by separating the string into substrings.</p>
<p>The <a href='#method-split'>split</a> method returns the new array.</p>
<p>When found, <code>separator</code> is removed from the string and the substrings are returned in an array. If
<code>separator</code> is omitted, the array contains one element consisting of the entire string.</p>
<p>If <code>separator</code> is a regular expression that contains capturing parentheses, then each time separator
is matched the results (including any undefined results) of the capturing parentheses are spliced
into the output array. However, not all browsers support this capability.</p>
<p>Note: When the string is empty, <a href='#method-split'>split</a> returns an array containing one empty string, rather than an
empty array.</p>
<p>The following example defines a function that splits a string into an array of strings using the
specified separator. After splitting the string, the function displays messages indicating the
original string (before the split), the separator used, the number of elements in the array, and the
individual array elements.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function splitString(stringToSplit,separator)
{
    var arrayOfStrings = stringToSplit.split(separator);
    print(&#39;The original string is: &quot;&#39; + stringToSplit + &#39;&quot;&#39;);
    print(&#39;The separator is: &quot;&#39; + separator + &#39;&quot;&#39;);
    print(&quot;The array has &quot; + arrayOfStrings.length + &quot; elements: &quot;);

    for (var i=0; i &lt; arrayOfStrings.length; i++)
        print(arrayOfStrings[i] + &quot; / &quot;);
}

var tempestString = &quot;Oh brave new world that has such people in it.&quot;;
var monthString = &quot;Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec&quot;;

var space = &quot; &quot;;
var comma = &quot;,&quot;;

splitString(tempestString, space);
splitString(tempestString);
splitString(monthString, comma);
</code></pre></div><p>This example produces the following output:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">The original string is: &quot;Oh brave new world that has such people in it.&quot;
The separator is: &quot; &quot;
The array has 10 elements: Oh / brave / new / world / that / has / such / people / in / it. /

The original string is: &quot;Oh brave new world that has such people in it.&quot;
The separator is: &quot;undefined&quot;
The array has 1 elements: Oh brave new world that has such people in it. /
</code></pre></div><p>The original string is: &quot;Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec&quot;
The separator is: &quot;,&quot;
The array has 12 elements: Jan / Feb / Mar / Apr / May / Jun / Jul / Aug / Sep / Oct / Nov / Dec /</p>
<p>In the following example, <a href='#method-split'>split</a> looks for 0 or more spaces followed by a semicolon followed by 0
or more spaces and, when found, removes the spaces from the string. nameList is the array returned
as a result of split.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var names = &quot;Harry Trump ;Fred Barney; Helen Rigby ; Bill Abel ;Chris Hand &quot;;
print(names);
var re = /\s*;\s*\/;
var nameList = names.split(re);
print(nameList);
</code></pre></div><p>This prints two lines; the first line prints the original string, and the second line prints the
resulting array.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">Harry Trump ;Fred Barney; Helen Rigby ; Bill Abel ;Chris Hand
Harry Trump,Fred Barney,Helen Rigby,Bill Abel,Chris Hand
</code></pre></div><p>In the following example, split looks for 0 or more spaces in a string and returns the first 3
splits that it finds.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var myString = &quot;Hello World. How are you doing?&quot;;
var splits = myString.split(&quot; &quot;, 3);
print(splits);
</code></pre></div><p>This script displays the following:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">Hello,World.,How
</code></pre></div><p>If <code>separator</code> contains capturing parentheses, matched results are returned in the array.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var myString = &quot;Hello 1 word. Sentence number 2.&quot;;
var splits = myString.split(/(\d)/);
print(splits);
</code></pre></div><p>This script displays the following:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">Hello ,1, word. Sentence number ,2, .
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-split--seperator">seperator</span> :
                            <span class="memberType">&nbsp;<a href='String.html'>String</a></span>
                        
                    </p>
                    <div class="params-desc"><p>Specifies the character to use for separating the string. The separator is treated as a string or a
regular expression. If separator is omitted, the array returned contains one element consisting of the entire string.</p>
</div>

                </div>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-split--limit">limit</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>Integer specifying a limit on the number of splits to be found.  The split method still splits on every
match of separator, but it truncates the returned array to at most limit elements.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='Array.html'>Array</a></span>
                <div class="return-desc"><p>Substrings are returned in an array.</p>
</div>

    </div>
  
                            <div id="method-substr" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="substr" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-substr">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-substr" class="member-name-link"><span data-ref="method-substr" class="member-name">substr</span></a>
            <span class="params-list"> (
                        
                        start
                        , 
                        length
                            

                )</span>

                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the characters in a string beginning at the specified location through the specified number
of characters.</p>
<p><code>start</code> is a character index. The index of the first character is 0, and the index of the last
character is 1 less than the length of the string. <a href='#method-substr'>substr</a> begins extracting characters at start
and collects length characters (unless it reaches the end of the string first, in which case it will
return fewer).</p>
<p>If <code>start</code> is positive and is greater than or equal to the length of the string, <a href='#method-substr'>substr</a> returns an
empty string.</p>
<p>If <code>start</code> is negative, <a href='#method-substr'>substr</a> uses it as a character index from the end of the string. If start
is negative and abs(start) is larger than the length of the string, <a href='#method-substr'>substr</a> uses 0 as the start
index. Note: the described handling of negative values of the start argument is not supported by
Microsoft JScript.</p>
<p>If length is 0 or negative, <a href='#method-substr'>substr</a> returns an empty string. If length is omitted, <a href='#method-substr'>substr</a>
extracts characters to the end of the string.</p>
<p>Consider the following script:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">// assumes a print function is defined
var str = &quot;abcdefghij&quot;;
print(&quot;(1,2): &quot;    + str.substr(1,2));
print(&quot;(-3,2): &quot;   + str.substr(-3,2));
print(&quot;(-3): &quot;     + str.substr(-3));
print(&quot;(1): &quot;      + str.substr(1));
print(&quot;(-20, 2): &quot; + str.substr(-20,2));
print(&quot;(20, 2): &quot;  + str.substr(20,2));
</code></pre></div><p>This script displays:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">(1,2): bc
(-3,2): hi
(-3): hij
(1): bcdefghij
(-20, 2): ab
(20, 2):
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-substr--start">start</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>Location at which to begin extracting characters.</p>
</div>

                </div>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-substr--length">length</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>The number of characters to extract.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Modified string.</p>
</div>

    </div>
  
                            <div id="method-substring" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="substring" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-substring">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-substring" class="member-name-link"><span data-ref="method-substring" class="member-name">substring</span></a>
            <span class="params-list"> (
                        
                        indexA
                        , 
                        [indexB]
                            

                )</span>

                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the characters in a string between two indexes into the string.</p>
<p>substring extracts characters from indexA up to but not including indexB. In particular:</p>
<ul>
<li>If <code>indexA</code> equals <code>indexB</code>, <a href='#method-substring'>substring</a> returns an empty string.</li>
<li>If <code>indexB</code> is omitted, substring extracts characters to the end of the string.</li>
<li>If either argument is less than 0 or is <code>NaN</code>, it is treated as if it were 0.</li>
<li>If either argument is greater than <code>stringName.length</code>, it is treated as if it were
<code>stringName.length</code>.</li>
</ul>
<p>If <code>indexA</code> is larger than <code>indexB</code>, then the effect of substring is as if the two arguments were
swapped; for example, <code>str.substring(1, 0) == str.substring(0, 1)</code>.</p>
<p>The following example uses substring to display characters from the string &quot;Sencha&quot;:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">// assumes a print function is defined
var anyString = &quot;Sencha&quot;;

// Displays &quot;Sen&quot;
print(anyString.substring(0,3));
print(anyString.substring(3,0));

// Displays &quot;cha&quot;
print(anyString.substring(3,6));
print(anyString.substring(6,3));

// Displays &quot;Sencha&quot;
print(anyString.substring(0,6));
print(anyString.substring(0,10));
</code></pre></div><p>The following example replaces a substring within a string. It will replace both individual
characters and <code>substrings</code>. The function call at the end of the example changes the string &quot;Brave
New World&quot; into &quot;Brave New Web&quot;.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">function replaceString(oldS, newS, fullS) {
    // Replaces oldS with newS in the string fullS
    for (var i = 0; i &lt; fullS.length; i++) {
        if (fullS.substring(i, i + oldS.length) == oldS) {
            fullS = fullS.substring(0, i) + newS + fullS.substring(i + oldS.length,
</code></pre></div><p>fullS.length);
            }
        }
        return fullS;
    }</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">replaceString(&quot;World&quot;, &quot;Web&quot;, &quot;Brave New World&quot;);
</code></pre></div>
            <h3 class="detail-header">Parameters</h3>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-substring--indexA">indexA</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        
                    </p>
                    <div class="params-desc"><p>An integer between 0 and one less than the length of the string.</p>
</div>

                </div>
                <div class="param-row">
                    <p><span class="params-list param-list-item" id="method-substring--indexB">indexB</span> :
                            <span class="memberType">&nbsp;<a href='Number.html'>Number</a></span>
                        <i class="memberType">(optional)</i>
                    </p>
                    <div class="params-desc"><p>An integer between 0 and the length of the string.</p>
</div>

                </div>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Returns the characters in a string between two indexes into the string.</p>
</div>

    </div>
  
                            <div id="method-toLocaleLowerCase" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="toLocaleLowerCase" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-toLocaleLowerCase">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-toLocaleLowerCase" class="member-name-link"><span data-ref="method-toLocaleLowerCase" class="member-name">toLocaleLowerCase</span></a>
            
                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>The characters within a string are converted to lower case while respecting the current locale. For
most languages, this will return the same as <a href='#method-toLowerCase'>toLowerCase</a>.</p>
<p>The <a href='#method-toLocaleLowerCase'>toLocaleLowerCase</a> method returns the value of the string converted to lower case according to
any locale-specific case mappings. <a href='#method-toLocaleLowerCase'>toLocaleLowerCase</a> does not affect the value of the string
itself. In most cases, this will produce the same result as <code>toLowerCase()</code>, but for some locales,
such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may
be a different result.</p>
<p>The following example displays the string &quot;sencha&quot;:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var upperText=&quot;SENCHA&quot;;
document.write(upperText.toLocaleLowerCase());
</code></pre></div>
            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Returns value of the string in lowercase.</p>
</div>

    </div>
  
                          
                            <div id="method-toLocaleUpperCase" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="toLocaleUpperCase" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-toLocaleUpperCase">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-toLocaleUpperCase" class="member-name-link"><span data-ref="method-toLocaleUpperCase" class="member-name">toLocaleUpperCase</span></a>
            
                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>The characters within a string are converted to upper case while respecting the current locale. For
most languages, this will return the same as <a href='#method-toUpperCase'>toUpperCase</a>.</p>
<p>The <a href='#method-toLocaleUpperCase'>toLocaleUpperCase</a> method returns the value of the string converted to upper case according to
any locale-specific case mappings. <a href='#method-toLocaleUpperCase'>toLocaleUpperCase</a> does not affect the value of the string
itself. In most cases, this will produce the same result as <code>toUpperCase()</code>, but for some locales,
such as Turkish, whose case mappings do not follow the default case mappings in Unicode, there may
be a different result.</p>
<p>The following example displays the string &quot;SENCHA&quot;:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var lowerText=&quot;sencha&quot;;
document.write(lowerText.toLocaleUpperCase());
</code></pre></div>
            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Returns value of the string in uppercase.</p>
</div>

    </div>
  
                            <div id="method-toLowerCase" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="toLowerCase" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-toLowerCase">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-toLowerCase" class="member-name-link"><span data-ref="method-toLowerCase" class="member-name">toLowerCase</span></a>
            
                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the calling string value converted to lower case.</p>
<p>The <a href='#method-toLowerCase'>toLowerCase</a> method returns the value of the string converted to lowercase. <a href='#method-toLowerCase'>toLowerCase</a> does
not affect the value of the string itself.</p>
<p>The following example displays the lowercase string &quot;sencha&quot;:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var upperText=&quot;SENCHA&quot;;
document.write(upperText.toLowerCase());
</code></pre></div>
            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Returns value of the string in lowercase.</p>
</div>

    </div>
  
                            <div id="method-toString" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="toString" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-toString">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-toString" class="member-name-link"><span data-ref="method-toString" class="member-name">toString</span></a>
            
                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns a string representing the specified object. Overrides the <code>Object.toString</code> method.</p>
<p>The <a href='String.html'>String</a> object overrides the <a href='#method-toString'>toString</a> method of the <a href='Object.html'>Object</a> object; it does not inherit
<code>Object.toString</code>. For <a href='String.html'>String</a> objects, the <a href='#method-toString'>toString</a> method returns a string representation of
the object.</p>
<p>The following example displays the string value of a String object:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">x = new String(&quot;Hello world&quot;);
alert(x.toString())      // Displays &quot;Hello world&quot;
</code></pre></div>
            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>A string representation of the object.</p>
</div>

    </div>
  
                            <div id="method-toUpperCase" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="toUpperCase" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-toUpperCase">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-toUpperCase" class="member-name-link"><span data-ref="method-toUpperCase" class="member-name">toUpperCase</span></a>
            
                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the calling string value converted to uppercase.</p>
<p>The <a href='#method-toUpperCase'>toUpperCase</a> method returns the value of the string converted to uppercase. <a href='#method-toUpperCase'>toUpperCase</a> does
not affect the value of the string itself.</p>
<p>The following example displays the string &quot;SENCHA&quot;:
    var lowerText=&quot;sencha&quot;;
    document.write(lowerText.toUpperCase());</p>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Returns value of the string in uppercase.</p>
</div>

    </div>
  
                            <div id="method-trim" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="trim" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-trim">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-trim" class="member-name-link"><span data-ref="method-trim" class="member-name">trim</span></a>
            
                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Removes whitespace from both ends of the string.</p>
<p>Does not affect the value of the string itself.</p>
<p>The following example displays the lowercase string <code>&quot;foo&quot;</code>:</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">var orig = &quot;   foo  &quot;;
alert(orig.trim());
</code></pre></div><p><strong>NOTE:</strong> This method is part of the ECMAScript 5 standard.</p>

            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>A string stripped of whitespace on both ends.</p>
</div>

    </div>
  
                            <div id="method-valueOf" class="classmembers member member-public isNotStatic  is-not-inherited    " data-member-name="valueOf" >
        <div class="collapse-toggle"></div>
        <div class="source-class"><a href="String.html">String<div class="viewSource"><a target="_blank" href="src/String.js.html#String-method-valueOf">view source</a></div></a></div>
        <h2 class="member-header">
            <a href="#method-valueOf" class="member-name-link"><span data-ref="method-valueOf" class="member-name">valueOf</span></a>
            
                :
                    <span class="memberType"><a href='String.html'>String</a></span>

            <div class="member-tags">
            </div>
        </h2>

            <p>Returns the primitive value of the specified object. Overrides the <code>Object.valueOf</code> method.</p>
<p>The <a href='#method-valueOf'>valueOf</a> method of String returns the primitive value of a <a href='String.html'>String</a> object as a string data
type. This value is equivalent to <code>String.toString</code>.</p>
<p>This method is usually called internally by JavaScript and not explicitly in code.</p>
<div class="code-snippet-wrap"><div class="code-controls example-collapse-target"><span class="collapse-tool"></span><span class="expand-tool"></span>Sample Code</div><pre><code class="language-javascript">x = new String(&quot;Hello world&quot;);
alert(x.valueOf())          // Displays &quot;Hello world&quot;
</code></pre></div>
            <h3 class="detail-header">Returns</h3>
                :<span style="margin-left:12px;" class="memberType"><a href='String.html'>String</a></span>
                <div class="return-desc"><p>Returns value of string.</p>
</div>

    </div>
  
                </div>
        </div>
    </div>
    <div id="footer">
        <p>
            <a href="../../https@www.facebook.com/senchainc/" target="_blank"><img class="social" src="home-images/fb.png"/></a>
            <a href="../../https@www.linkedin.com/company/sencha-inc" target="_blank"><img class="social" src="home-images/in.png"/></a>
            <a href="../../https@twitter.com/Sencha" target="_blank"><img class="social" src="home-images/twt.png"/></a>
            Sencha Test 1.0.3  | <a href='../../https@www.sencha.com/legal/terms-of-use/' target='_blank'>Terms of Use</a>
        </p>
    </div>
</div>

        </div>
    </div>
    <h2 class="product-header"><a href="index.html">Sencha Test 1.0.3 </a>
        <span data-tip="Product / Version Menu" class="fa fa-chevron-circle-down product-menu-btn tooltip tooltip-tl-bl"><div class="callout callout-b"></div></span>
        <div id="peekaboo-input" class="peekaboo-input">
            <input type="text" id="mobile-input" />
        </div>
    </h2>

    <div id="product-tree-ct" class="hide">
        <div id="product-tree">
            <div class="product-name-ct">
                    <div id="product-menu-extjs" class="product-name-item">Ext JS</div>
                    <div id="product-menu-sencha_test" class="product-name-item">Sencha Test</div>
                    <div id="product-menu-cmd" class="product-name-item">Cmd</div>
                    <div id="product-menu-gxt" class="product-name-item">GXT</div>
                    <div id="product-menu-ide_plugins" class="product-name-item">IDE Plugins</div>
                    <div id="product-menu-sencha_inspector" class="product-name-item">Sencha Inspector</div>
                    <div id="product-menu-architect" class="product-name-item">Architect</div>
                    <div id="product-menu-touch" class="product-name-item">Touch</div>
                    <div id="product-menu-webappmgr" class="product-name-item">Web Application Manager</div>
            </div>
                <div class="product-version-ct hide extjs">
                        <h2>Ext JS</h2>
                            <h3>6.x</h3>
                                        <div class="compound-product-item">6.2.0 EA
                                                <a  href="../extjs/6.2.0-classic/index.html">(classic)</a>
                                                <a  href="../extjs/6.2.0-modern/index.html">(modern)</a>
                                        </div>
                                        <div class="compound-product-item">6.0.2
                                                <a  href="../extjs/6.0.2-classic/index.html">(classic)</a>
                                                <a  href="../extjs/6.0.2-modern/index.html">(modern)</a>
                                        </div>
                                        <div class="compound-product-item">6.0.1
                                                <a  href="../extjs/6.0.1-classic/index.html">(classic)</a>
                                                <a  href="../extjs/6.0.1-modern/index.html">(modern)</a>
                                        </div>
                                        <div class="compound-product-item">6.0.0
                                                <a  href="../extjs/6.0.0-classic/index.html">(classic)</a>
                                                <a  href="../extjs/6.0.0-modern/index.html">(modern)</a>
                                        </div>
                            <h3>5.x</h3>
                                        <a class="product-item" href="../extjs/5.1.3/index.html">5.1.3</a>
                                        <a class="product-item" href="../extjs/5.1.2/index.html">5.1.2</a>
                                        <a class="product-item" href="../extjs/5.1.1/index.html">5.1.1</a>
                                        <a class="product-item" href="../extjs/5.1.0/index.html">5.1.0</a>
                                        <a class="product-item" href="../extjs/5.0.1/index.html">5.0.1</a>
                                        <a class="product-item" href="../extjs/5.0.0/index.html">5.0.0</a>
                            <h3>4.x</h3>
                                        <a class="product-item" href="../extjs/4.2.5/">4.2.5</a>
                                        <a class="product-item" href="../extjs/4.1.3/">4.1.3</a>
                                        <a class="product-item" href="../extjs/4.0.7/">4.0.7</a>
                            <h3>3.x</h3>
                                        <a class="product-item" href="../extjs/3.4.0/">3.4.0</a>
                </div>
                <div class="product-version-ct hide sencha_test">
                        <h2>Sencha Test</h2>
                        <a  href="index.html">Sencha Test</a>
                </div>
                <div class="product-version-ct hide cmd">
                        <h2>Cmd</h2>
                        <a  href="../cmd/index.html">Cmd</a>
                </div>
                <div class="product-version-ct hide gxt">
                        <h2>GXT</h2>
                                <a class="product-item" href="../gxt/4.x/index.html">4.x</a>
                                <a class="product-item" href="../gxt/3.x/index.html">3.x</a>
                </div>
                <div class="product-version-ct hide ide_plugins">
                        <h2>IDE Plugins</h2>
                        <a  href="../ide_plugins/index.html">IDE Plugins</a>
                </div>
                <div class="product-version-ct hide sencha_inspector">
                        <h2>Sencha Inspector</h2>
                        <a  href="../sencha_inspector/index.html">Sencha Inspector</a>
                </div>
                <div class="product-version-ct hide architect">
                        <h2>Architect</h2>
                                <a class="product-item" href="../architect/3/index.html">Architect 3</a>
                                <a class="product-item" href="../architect/4/index.html">Architect 4 EA</a>
                </div>
                <div class="product-version-ct hide touch">
                        <h2>Touch</h2>
                            <h3>2.x</h3>
                                        <a class="product-item" href="../touch/2.4/index.html">Touch 2.4</a>
                                        <a class="product-item" href="../touch/2.3.1/">Touch 2.3</a>
                                        <a class="product-item" href="../touch/2.2.1/">Touch 2.2</a>
                                        <a class="product-item" href="../touch/2.0.2/">Touch 2.0</a>
                </div>
                <div class="product-version-ct hide webappmgr">
                        <h2>Web Application Manager</h2>
                        <a  href="../webappmgr/index.html">Web Application Manager</a>
                </div>
        </div>
    </div>

    <div id="historyConfigPanel">
        <div class="history-type-selector">
            <input id="historyTypeCurrent" type="radio" name="historyType" value="current" checked="true" />
            <label for="historyTypeCurrent">Current Product / Version</label><br>
            <input id="historyTypeAll" type="radio" name="historyType" value="all" />
            <label for="historyTypeAll">All</label><br>
            <div id="history-label-toggle">
                <input id="history-all-labels" type="checkbox" checked="true" />
                <label for="history-all-labels">Show product details in the history bar</label>
                <div class="mask"></div>
            </div>
            <span id="history-clear" class="tooltip tooltip-tr-br" data-tip="Clear History"><div class="history-clear callout callout-b"></div></span>
        </div>
        <div id="history-full-list"></div>
    </div>

    <div id="search-history-panel"></div>

</body>
    <script type="text/javascript" src="js/searchIndex.js"></script>
    <script type="text/javascript" src="js/guideSearch.js"></script>
<!--[if lt IE 9 ]>
<script type="text/javascript" src="js/media-query-poly.js"></script>
<style>
    span.da-inline-fiddle-nav-fiddle.x-fa.fa-play-circle {
        display: none;
    }
</style>
<![endif]-->
<script>
    if (navigator.userAgent.indexOf("Safari") > -1) {
        window.onpageshow = function(event) {
            if (event.persisted) {
                window.location.reload()
            }
        };
    }

    document.onreadystatechange = function () {
        if (document.readyState == "interactive") {
            //
        }
    }
</script>

</html>
